package com.cash.channel.api.model.response;

import com.cash.channel.api.model.DataModel;
import com.google.common.collect.Lists;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

@Data
public class BankCardListResponse implements DataModel, Serializable {

    private List<BankCard> bankCardList = Lists.newLinkedList();

    @Data
    class BankCard implements Serializable {

        public BankCard(String uid, String idNo, String name, String cardNo, String bankCode, String bankName, String reserveMobile, Boolean defaultFlag, String channel) {
            this.uid = uid;
            this.idNo = idNo;
            this.name = name;
            this.cardNo = cardNo;
            this.bankCode = bankCode;
            this.bankName = bankName;
            this.reserveMobile = reserveMobile;
            this.defaultFlag = defaultFlag;
            this.channel = channel;
        }

        private String uid;

        private String idNo;

        private String name;

        private String cardNo;

        private String bankCode;

        private String bankName;

        private String reserveMobile;

        private Boolean defaultFlag;

        private String channel;

    }

    public void addBankCard(String uid, String idNo, String name, String cardNo, String bankCode, String bankName, String reserveMobile, Boolean defaultFlag, String channel) {
        if (this.bankCardList==null) {
            this.bankCardList = Lists.newLinkedList();
        }
        this.bankCardList.add(new BankCard(uid, idNo, name, cardNo, bankCode, bankName, reserveMobile, defaultFlag, channel));
    }

}
